#ifdef __cplusplus
extern "C"{
#endif
#include "xs_log.h"
#include "xs_malloc.h"

void* __xs_malloc(int size, const char *file, int line)
{
    file = file;line=line;

    void* ptr = malloc(size);

    if(ptr == NULL)
        xs_logd("sys malloc : can't alloc memory \n");

    return ptr;
}
void* __xs_zalloc(int size, const char *file, int line)
{
    void* ptr = malloc(size);

    file = file;line=line;

    if(ptr == NULL)
        xs_logd("sys malloc : can't alloc memory \n");
    else
        memset(ptr, 0, size);

    return ptr;
}
char* __xs_strdup(const char *ss, const char *file, int line)
{
    file = file;line=line;
    return strdup(ss);
}
void __xs_free(void* ptr, const char* file, int line)
{
    file = file; line = line;

    if(ptr == NULL)
        xs_logd("sys_free : NULL memory point \n");
    else
    {
        free(ptr);
        ptr = NULL;
    }
}
void* __xs_realloc(void* ptr, int size, const char* file, int line)
{
    file = file;line=line;
    return realloc(ptr, size);
}

void *__xs_calloc(size_t nmemb, size_t size, const char* file, int line)
{
    file = file;line=line;
    return calloc(nmemb, size);
}
#ifdef __cplusplus
}
#endif
